﻿using DevExpress.LookAndFeel;
using MDK.Common;
using MDK.Device;
using MDK.Device.Helper;
using MDK.WebApi;
using MDK.Winform;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Linq.Expressions;
using System.Windows.Forms;

namespace MDK.Winform
{
    static class Program
    {
        /// <summary>
        /// 应用程序的主入口点。
        /// </summary>
        [STAThread]
        static void Main()
        {
            System.Threading.Thread.CurrentThread.CurrentUICulture = new System.Globalization.CultureInfo("zh-CN");
            System.Threading.Thread.CurrentThread.CurrentCulture = new System.Globalization.CultureInfo("zh-CN");

            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);

            DevExpress.Skins.SkinManager.EnableFormSkins();
            DevExpress.UserSkins.BonusSkins.Register();
            UserLookAndFeel.Default.SetSkinStyle("Office 2013");
            DevExpress.Utils.AppearanceObject.DefaultFont = new System.Drawing.Font("微软雅黑", 24f);
            #region 阻截未处理的异常

            AppDomain.CurrentDomain.UnhandledException += (sender, e) =>
            {
                LogHelper.Error(e.ExceptionObject.ToString());
            };

            Application.ThreadException += (sender, e) =>
            {
                LogHelper.Error(e.Exception.Message.ToString());
            };
            #endregion 阻截未处理的异常
            Application.Run(new Index());
        }
    }
}
